<div class="crayons-field mt-6 align-left">
  <%= f.label :community_name, class: "crayons-field__label" do %>
    Community name
    <span class="crayons-field__required crayons-tooltip" data-tooltip="This will set the primary name for your Forem" aria-describedby="community-name-subtitle"></span>
    <p id="community-name-subtitle" class="crayons-field__description">Used as the primary name for your Forem.</p>
  <% end %>
  <%= f.text_field :community_name, placeholder: "Climbing Life", class: "crayons-textfield", required: true %>
</div>

<%= render partial: "admin/shared/logo_upload", locals: { allowed_types: @logo_allowed_types, max_file_size: @max_file_size, f: f, logo: Settings::General.resized_logo } %>

<div class="crayons-field mt-6 align-left">
  <%= f.label :primary_brand_color_hex, class: "crayons-field__label" do %>
    Brand color
    <span class="crayons-field__required crayons-tooltip" data-tooltip="This will set the accent color for buttons, links, etc. on your Forem" aria-describedby="color-selector-subtitle"></span>
    <p id="color-selector-subtitle" class="crayons-field__description">This will be the "accent" color used for buttons, links, etc.</p>
  <% end %>

  <div class="crayons-field">
    <div class="flex">
      <%= f.text_field :primary_brand_color_hex,
                       pattern: "^#+([a-fA-F0-9]{6})$",
                       title: "Provide a valid HEX Color or pick your color from the color picker.",
                       placeholder: ::Settings::UserExperience.primary_brand_color_hex,
                       class: "crayons-textfield",
                       "aria-describedby": "color-contrast-error" %>

    </div>
  </div>
  <div id="color-contrast-error" aria-live="polite" class="mt-1 color-accent-danger"></div>
</div>

<div class="crayons-field mt-6 align-left">
  <fieldset aria-describedby="section-description">
    <legend class="crayons-field__label mb-2">Who can join this community?</legend>
    <div class="flex gap-3">
      <div>
        <%= f.radio_button :invite_only_mode, false, class: "crayons-radio", role: "radio" %>
        <%= label_tag "creator_settings_form_invite_only_mode_false", "Everyone" %>
      </div>
      <div>
        <%= f.radio_button :invite_only_mode, true, class: "crayons-radio", role: "radio" %>
        <%= label_tag "creator_settings_form_invite_only_mode_true", "Invite Only" %>
      </div>
    </div>
  </fieldset>
</div>

<div class="crayons-field mt-6 align-left">
  <fieldset aria-describedby="section-description">
    <legend class="crayons-field__label mb-2">Who can view content in this community?</legend>
    <div class="flex gap-3">
      <div>
        <%= f.radio_button :public, true, class: "crayons-radio", role: "radio" %>
        <%= label_tag "creator_settings_form_public_true", "Everyone" %>
      </div>
      <div>
        <%= f.radio_button :public, false, class: "crayons-radio", role: "radio" %>
        <%= label_tag "creator_settings_form_public_false", "Members Only" %>
      </div>
    </div>
  </fieldset>
</div>

<div class="crayons-field mt-6 align-left">
  <fieldset aria-describedby="section-description">
    <legend class="crayons-field__label">Finally, please agree to the following:</legend>
    <div>
      <p class="crayons-field__description">You will have the opportunity to establish the Code of Conduct and Terms and Conditions for the users of your Forem during the setup process.</p>
      <div class="mb-2">
        <%= f.check_box :checked_code_of_conduct, class: "crayons-checkbox", required: true %>
        <%= f.label :checked_code_of_conduct do %>
          I agree to uphold our <a href="/code-of-conduct" target="code-of-conduct">Code of Conduct</a>.
        <% end %>
      </div>
      <div>
        <%= f.check_box :checked_terms_and_conditions, class: "crayons-checkbox", required: true %>
        <%= f.label :checked_terms_and_conditions do %>
          I agree to our <a href="/terms" target="terms-and-conditions">Terms and Conditions</a>.
        <% end %>
      </div>
    </div>
  </fieldset>
</div>
<%= javascript_include_tag "admin/creatorOnboarding", defer: true %>
